package com.lmabbe.tenant.objects.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsNativeDefValue;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.lmabbe.common.global.constant.GlobalConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 系统字典表
 *
 * @author lmabbe
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "系统字典明细表")
@Table(isSimple = true, comment = "系统字典明细表")
public class SysDicItem {

    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "ID")
    @Column(isKey = true, isNull = false, length = 32, comment = "字典条目ID")
    private Long itemId;

    /**
     * 所属字典ID
     */
    @TableField()
    @ApiModelProperty(value = "所属字典ID")
    @Column(comment = "所属字典ID")
    private Long dicId;

    /**
     * 条目的code
     */
    @TableField()
    @ApiModelProperty(value = "条目的code")
    @Column(comment = "条目的code")
    private String itemCode;

    /**
     * 条目的名称
     */
    @TableField()
    @ApiModelProperty(value = "条目的名称")
    @Column(comment = "条目的名称")
    private String itemName;

    /**
     * 排序,越小越靠前
     */
    @TableField()
    @ApiModelProperty(value = "排序,越小越靠前")
    @Column(comment = "排序,越小越靠前")
    private Integer sort;

    /**
     * 是否必选(true:是 false:否)
     */
    @TableField()
    @Column(comment = "是否必选", type = MySqlTypeConstant.TINYINT, defaultValue = "0")
    private Boolean mandatory;

    /**
     * 是否是平台参数(true:是 false:否)
     */
    @TableField()
    @Column(comment = "是否是平台参数", type = MySqlTypeConstant.TINYINT, defaultValue = "0")
    private Boolean platform;

    /**
     * 是否只读(true:是 false:否)
     */
    @TableField()
    @Column(comment = "是否是只读", type = MySqlTypeConstant.TINYINT, defaultValue = "0")
    private Boolean readonly;

    /**
     * 是否有效(1.有效 0.无效 -1.软删除)
     */
    @TableField()
    @ApiModelProperty(value = "是否有效(1.有效 0.无效 -1.软删除)")
    @Column(comment = "是否有效(1.有效 0.无效 -1.软删除)", defaultValue = "1")
    @TableLogic(value = GlobalConstant.IS_VALID.YES_STR, delval = GlobalConstant.IS_VALID.DELETE_STR)
    private Integer valid;

    /**
     * 创建人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建人", defaultValue = "system")
    private String createBy;
    /**
     * 创建时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @TableField(fill = FieldFill.INSERT)
    @Column(isNull = false, comment = "创建时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP")
    private Date createTime;
    /**
     * 修改人
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(isNull = false, comment = "修改人", defaultValue = "system")
    private String modifyBy;
    /**
     * 修改时间
     *
     * @mbg.generated 2021-03-13 16:06:09
     */
    @IsNativeDefValue
    @Column(isNull = false, comment = "修改时间", type = MySqlTypeConstant.TIMESTAMP, defaultValue = "CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;
}
